﻿using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入第一个数");
            double Xz = Double.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个数");
            double Xc = Double.Parse(Console.ReadLine());
            Console.WriteLine("两数中较大的数{0}",Math.Max(Xz,Xc));
            Console.WriteLine("两数中较小的数{0}",Math.Min(Xz,Xc));



            Random random = new Random();
            Console.WriteLine("产生一个50以内的数:{0}",random.Next (0,50));
            Console.WriteLine("产生一个0-1之间的浮点数:{0}",random.NextDouble ());
            byte [] vs = new byte[5];
            random.NextBytes(vs);
            Console.WriteLine("产生一个byte的值");
            foreach(byte i in vs)
            {
                Console.Write(i + " ");
            }
            Console.WriteLine();




            DateTime dateTime=DateTime.Now ;
            Console.WriteLine("当前日期为：{0}",dateTime);
            Console.WriteLine("本月的第几天：{0}",dateTime.Day);
            Console.WriteLine("今天是：{0}",dateTime.DayOfWeek);
            Console.WriteLine("今天是今年的第几天：{0}",dateTime.DayOfYear);
            Console.WriteLine("30天后的日期{0}",dateTime .AddDays(30));

            DateTime dateTime1 = new DateTime(2001, 1, 29);
            TimeSpan ts = dateTime-dateTime1;
            Console.WriteLine("间隔的天数为{0}天", ts.Days);
        }
    }
}
